import request from "@/utils/request";
export function getCommunityList(params){
    return request({
        url:'/community/list',
        method:'get',
        params:params
    })
}
export function getCommunityById(id){
    return request({
        url:"/community/detail/"+id,
        method:'get'
    })
}
export function isJoined(id){
    return request({
        url:"/community/isJoined/"+id,
        method:'get',
        headers:{
            isToken:true
        }
    })

}

export function join(id){
    return request({
        url:'/community/join/'+id,
        method:'post',
        headers:{
            isToken:true
        }
    })
}

export function cancelJoin(id){
    return request({
        url:'/community/join/'+id,
        method:'delete',
        headers:{
            isToken:true
        }
    })
}

export function myMemberInfo(){
    return request({
        url:'/community/member/me/info',
        method:'get',
        headers:{
            isToken:true
        }
    })
}

export function getJoinedCommunity(){
    return request({
        url:'/community/joined',
        method:'get',
        headers:{
            isToken:true
        }
    })
}